-- GENERATED SPELL FOR [Spectral Rider] --


function spell0_16150(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(27994,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_16150', 5000, 1)
end

function spell1_16150(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(55646,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_16150', 5000, 1)
end

function spell2_16150(pUnit, Event) --@Unholy Aura,Self--
pUnit:FullCastSpellOnTarget(55606,pUnit)
pUnit:RegisterEvent('Sorts_16150', 0, 1)
end

function spell3_16150(pUnit, Event) --@Unholy Aura,Self--
pUnit:FullCastSpellOnTarget(55608,pUnit)
pUnit:RegisterEvent('Sorts_16150', 0, 1)
end

function spell4_16150(pUnit, Event) --@Unholy Frenzy,n/a--
pUnit:FullCastSpellOnTarget(27995,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16150', 20263, 1)
end

function spell5_16150(pUnit, Event) --@Unholy Frenzy,n/a--
pUnit:FullCastSpellOnTarget(55648,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16150', 20298, 1)
end

function Sorts_16150(pUnit, Event)
local choix_sorts_16150 = math.random(0, 5)
if choix_sorts_16150 == 0 then
pUnit:RegisterEvent('spell0_16150', 1, 1)
end
if choix_sorts_16150 == 1 then
pUnit:RegisterEvent('spell1_16150', 1, 1)
end
if choix_sorts_16150 == 2 then
pUnit:RegisterEvent('spell2_16150', 1, 1)
end
if choix_sorts_16150 == 3 then
pUnit:RegisterEvent('spell3_16150', 1, 1)
end
if choix_sorts_16150 == 4 then
pUnit:RegisterEvent('spell4_16150', 1, 1)
end
if choix_sorts_16150 == 5 then
pUnit:RegisterEvent('spell5_16150', 1, 1)
end
end

function mob16150_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16150', math.random(1500, 3000), 1)
end

function mob16150_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16150_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16150_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16150, 1, 'mob16150_Action')
RegisterUnitEvent(16150, 2, 'mob16150_Leave')
RegisterUnitEvent(16150, 3, 'mob16150_Kill')
RegisterUnitEvent(16150, 4, 'mob16150_Die')
